﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Web;
using System.Web.Mvc;
using VVA.Website.UI.Helper;
using VVA.Website.UI.Models.ViewModel;
using VVA.Website.UI.Service;

namespace VVA.Website.UI.Controllers
{
    public class ContactController : BaseController
    {
        //
        // GET: /Contact/
        public ActionResult Index()
        {
            var model = new ContractDictionaryViewModel()
            {
                Telephone = DictionaryService.GetValueByKey("Telephone", Culture),
                Fax = DictionaryService.GetValueByKey("Fax", Culture),
                Email = DictionaryService.GetValueByKey("Email", Culture),
                CompanyName = DictionaryService.GetValueByKey("CompanyName", Culture),
                Website = DictionaryService.GetValueByKey("Website", Culture),
                Address = DictionaryService.GetValueByKey("Address", Culture)
            };

            return View(model);
        }

        public ActionResult Map()
        {
            return PartialView();
        }

        public ActionResult ContactForm()
        {
            return PartialView();
        }

        [HttpPost]
        public ActionResult Send(string name, string company, string subject, string email, string message)
        {
            MailMessage mailMessage = new MailMessage("webmaster@camchimvva.vn", "marketing@camchimvva.vn", subject, message);

            SmtpClient client = new SmtpClient();
            client.Send(mailMessage);

            return new EmptyResult();
        }
    }
}
